package com.jeomo.mem.starter.service;

import com.jeomo.base.starter.service.IBaseService;
import com.jeomo.common.core.dto.PageQueryDto;
import com.jeomo.common.core.request.PageRequest;
import com.jeomo.mem.starter.entity.MemberPointsRule;

import java.time.LocalDate;
import java.util.Date;

/**
 * @author:Jackpot
 * @create 2020-09-21 17:20
 * @description:
 */
public interface IMemberPointsRuleService  extends IBaseService<MemberPointsRule> {


    public PageQueryDto initParamAndSort(PageRequest pageRequest);


    /**
     * 查询/计算过期时间
     * @param memberPointsRule  积分规则实体
     * @param date 获得积分的时间
     * @return
     */
    LocalDate queryExpiredTime(MemberPointsRule memberPointsRule,LocalDate date);

    /**
     * 分页查询积分规则
     * @param pageNumber    开始页数
     * @param pageSize  每页大小
     * @param searchParams  查询参数(可为null)
     * @return
     */
//    List<MemberPointsRule> getRulesByPage(long pageNumber, long pageSize, Map<String, Object> searchParams);

    /**
     * 修改规则状态
     * @param ruleCode
     * @param status 开启/关闭
     * @return
     */
    int updateRuleStatus(String ruleCode,boolean status);
}
